import request from "@/request/index.js"

export function commit(type,shopId,items,addressId,payWay,remark,seatNo){
	let url = '/api/sale/order/commit'
	let data = {type,shopId,items,addressId,payWay,remark,seatNo}
	data.Loading = true 
	data.Json = true 
	return request.post(url,data)
}

export function cancel(orderId){
	let url = '/api/sale/order/cancel'
	let data  = {orderId}
	data.Loading = true 
	return request.post(url,data)
}

export function list(paid,status,page,limit){
	let url = '/api/sale/order/list'
	let params = {paid,status,page,limit}
	return request.get(url,{params})
}

export function info(id){
	let url = '/api/sale/order/info'
	let params = {id}
	return request.get(url,{params})
}

export function options() {
    let url =  '/sale/order/dmz/options'
    return request.get(url)
}

export function repay(orderId){
	let url = '/api/sale/order/repay'
	return request.post(url,{orderId,Loading:true})
}
